using System;

using Sce.Pss.HighLevel.GameEngine2D;
using Sce.Pss.HighLevel.GameEngine2D.Base;
using Sce.Pss.HighLevel.Physics2D;

using Sce.Pss.Core;
using Sce.Pss.Core.Environment;
using Sce.Pss.Core.Graphics;
using Sce.Pss.Core.Imaging;
using Sce.Pss.Core.Input;
using System.IO;
using System.Net;
using System.Collections.Generic;

namespace RedSkies
{
	public class PlayerSprite:CharacterSprite
	{
		private readonly IWorldMatrix worldMatrix;
		
		public PlayerSprite (TextureInfo textureInfo, Vector2 center, IWorldMatrix worldMatrix, int speed, SpriteList sp):base(
			false,textureInfo, center, worldMatrix, speed, sp)
		{
		}
				
		public override Vector2 UpdatePosition ()
		{
			return HandleGamePadData (Speed, GamePad.GetData (0));
		}
		
		Vector2 HandleGamePadData (int speed, GamePadData gamePadData)
		{			
			Vector2 newPstn = new Vector2(Position.X, Position.Y);
									
			if(gamePadData.IsLeftPressed() && !WillBeLeftCollision())
			{
				newPstn = new Vector2(Position.X-speed, Position.Y);
				
				//
			}
			if(gamePadData.IsRightPressed() && !WillBeRightCollision())
			{
				newPstn = new Vector2(Position.X+speed, Position.Y);
				//
								
			}
			
			if (!IsJumping && gamePadData.IsCirclePressed())
			{
				WantToJump = true;	
			}
			
			return newPstn;
		}
		
	}
}

